<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>HiAll Administrator's Control Panel</title>
        <link rel="stylesheet" href="css/common.css" type="text/css" media="all" />
    </head>
    <body>
        <div id="append"></div>
        <div class="container">
                <h2 class="admintitle">自动评分规则设置</h2>

                <div id="srchuserdiv" class="tabcontentcur" style="width:90%;position:relative">
		     <form method="POST" action="index.php?c=ResumeAutoScore&a=SaveRuleData"> 
		     <input type="hidden" name="eid" id="eid" value="<?php echo $euid; ?>" />
                    <table  class="datalist fixwidth">
						<tbody><tr>
							<th nowrap="nowrap"></th>
							<th nowrap="nowrap">规则设置</th>
						</tr>
						<tr>
							<td>数据表</td>
							<td><select name="table_name" id="table_name">
							<option>请选择...</option>
							<?php
								if($table_list)
								{
									foreach($table_list as $table_name)	
									{
										echo '<option value="'.$table_name.'">'.$table_name.'</option>';
									}
								}
							?>
							</select></td>
						</tr>
						<tr>
							<td>字段</td>
							<td>
								<select name="table_fields" id="table_fields">
								</select>
							</td>
						</tr>
						<tr>
							<td>设置加分内容（用英文逗号分隔）</td>
							<td>
								<input type="text" id="keywords" name="keywords" value="" />
							</td>
						</tr>
						<tr>
							<td>设置加分</td>
							<td>
								<input type="text" id="score" name="score" value="0" />
							</td>
						</tr>

						<tr><td colspan="2"><input type="submit" value="保存" /></td></tr>
					</tbody></table>
			</form>
            </div>
        </div>

<script language="javascript" src="js/jquery.js"></script>
<script language="javascript" src="js/validator.js"></script>
<script language="javascript" src="js/jquery.cascade.js"></script>
<script language="javascript" src="js/jquery.cascade.ext.js"></script>
<script language="javascript">
$("#table_fields").cascade("#table_name",{
	ajax: {url: '?c=Ajax&a=TableFields' }
});
$("#table_fields").change(function(){
	var table_name = $("#table_name").val();
	var table_f = $("#table_fields").val();
	var eid = $("#eid").val();
	var str = "table_name="+table_name+"&table_f="+table_f+"&eid="+eid;
	$.ajax({
		"type":"GET",
		"url":"index.php?c=ResumeAutoScore&a=RuleData",
		"data":str,
		"success":function(data){
			var obj = eval('(' + data + ')');
			$("#keywords").val(obj.keywords);
			$("#score").val(obj.score);
		}
	});
});
</script>
<script>
Zvalidator.init();
</script>
    </body>
</html>
